/*
 * Copyright 2010-2012 Susanta Tewari. <freecode4susant@users.sourceforge.net>
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */

package genomemap.data;

import java.util.*;

/**
 * @author stewari1
 * @version 1.0
 * @created 03-Nov-2007 4:18:32 PM
 */
public class Gene extends DNA_Region {

    /**
     * collection of clones that have overlapping region with this gene
     */
    private Set<Clone> taggedCloneSet = new HashSet<>();

    /**
     * Constructs ...
     */
    public Gene() {}

    /**
     *
     * <code>isOverLapping</code>
     *
     * @param clone
     */
    public void addTaggedClone(Clone clone) {
        getTaggedCloneSet().add(clone);
    }

    public void removeAllTaggedClones() {
        getTaggedCloneSet().clear();
    }

    /**
     * checks if this gene has any tagged (overlapping in region) clone. This is a
     * convenience method that in turn checks if the set returned by method
     * <code>getTaggedCloneSet</code> is emplty.
     * @return true if and only if this gene has no tagged genes.
     */
    public boolean isTagged() {
        return !taggedCloneSet.isEmpty();
    }

    public Set<Clone> getTaggedCloneSet() {
        return taggedCloneSet;
    }

    public void setTaggedCloneSet(Set<Clone> newVal) {
        taggedCloneSet = newVal;
    }
}
